package net.srcz.jsjvm.core;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Set;

import org.objectweb.asm.ClassReader;

public class Converter {

	public static Set<String> convert(InputStream classInput,
			OutputStream jsOutput) throws IOException {
		ClassReader cr = new ClassReader(classInput);
		PrintStream ps = new PrintStream(jsOutput);
		JsClassVisitor js = new JsClassVisitor(cr.getClassName(),ps);
		cr.accept(js, 0);
		return js.getClassesRef();
	}

}
